<!DOCTYPE html>
<html>
<head>
    {include file="public/header" /}
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset class="table-search-fieldset">
            <legend>交易详情</legend>
            <div style="margin: 10px 10px 10px 10px">
                <table class="layui-table">
                    <thead>
                    <th>图片</th>
                    <th>名称</th>
                    <th>购买价格</th>
                    <th>出售价格</th>
                    <th>生长周期</th>
                    <th>收益比例</th>
                    <th>每日租金</th>
                    <th>生意描述</th>
                    <th>详情</th>
                    <th>收益金额</th>
                    </thead>
                    <tbody>
                    <tr>
                        <td style="cursor: pointer;text-align: center">
                            <div onclick="showImg(this)"><img src="/upload/{$info.industry_imgurl}" alt="" width="50px" height="50px"></div>
                        </td>
                        <td>{$info.industry_title}</td>
                        <td>{$info.buy_price|priceFormat}</td>
                        <td>{$info.sell_price|priceFormat}</td>
                        <td>{$info.growth_cycle}</td>
                        <td>{$info.earnings_ratio}</td>
                        <td>{$info.day_rent}</td>
                        <td>{$info.desc}</td>
                        <td>
                            <button class="layui-btn" onclick="showDetail()">查看</button>
                        </td>
                        <td>{$info.earnings_price|priceFormat}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="table-search-fieldset">
            {if condition="$mark==1"}
            <legend>买家信息</legend>
            {else/}
            <legend>卖家信息</legend>
            {/if}
            <div style="margin: 10px 10px 10px 10px">
                <table class="layui-table">
                    <thead>
                    <th>头像</th>
                    <th>名称</th>
                    <th>ID</th>
                    <th>当前等级</th>
                    <th>手机号</th>
                    <th>收款信息</th>
                    <th>支付金额</th>
                    </thead>
                    <tbody>
                    <tr>
                        <td style="cursor: pointer">
                            <div onclick="showImg(this)"><img src="/upload/{$memberInfo.head_portrait}" alt="" width="50px" height="50px"></div>
                        </td>
                        <td>{$memberInfo.name}</td>
                        <td>{$memberInfo.code}</td>
                        <td>{$memberInfo.title}</td>
                        <td style="cursor: pointer" onclick="showPhone('{$memberInfo.phone}')">{$memberInfo.phone|hidPhone}</td>
                        <td>
                            <button class="layui-btn" onclick="showCollection()">查看</button>
                        </td>
                        <td>
                            {if condition="$mark==1"}
                            {$info.buy_price|priceFormat}
                            {else/}
                            {$info.sell_price|priceFormat}
                            {/if}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form', 'table', 'laydate', 'layarea', 'tableSelect'], function () {
        var $ = layui.jquery,
            table = layui.table;
    });

    /*查看大图*/
    function showImg(t) {
        var t = $(t).find("img");
        //页面层
        layer.open({
            type: 1,
            title: '区域图片',
            skin: 'layui-layer-rim', //加上边框
            area: ['600px', '600px'], //宽高 t.width() t.height()
            shadeClose: true, //开启遮罩关闭
            end: function (index, layero) {
                return false;
            },
            content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" width=\'500px\'  style=\'margin-top: 25px;margin-left: 25px\'/></div>'
        });
    }

    /*查看手机号*/
    function showPhone(tel) {
        layer.open({
            type: 1
            , offset: 'auto' //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
            , content: '<div style="padding: 20px 100px;">' + tel + '</div>'
            , shade: 0.5 //不显示遮罩
            , shadeClose: true
        });
    }

    /*收款信息*/
    function showCollection() {
        layer.open({
            type: 1
            , title: '收款信息'
            , offset: 'auto'
            , area: ['50%', '30%']
            , content: "<table class='layui-table'><thead>" +
                "<th>微信</th><th>支付宝</th><th>银联</th>" +
                "</thead>" +
                "<tbody>" +
                "<tr><td>{$memberInfo.wx_number}</td><td>{$memberInfo.ali_number}</td><td>{$memberInfo.unionpay_number}</td></tr>" +
                "</tbody></table>"
            , shade: 0.5 //不显示遮罩
            , shadeClose: true
        });
    }

    /*查看详情*/
    function showDetail() {
        var info2 = {:json_encode($info.detail)};
        var info3 = "<div>"+info2+"</div>"
        layer.open({
            type: 1
            , offset: 'auto'
            , area: ['80%', '80%']
            , content: info3
            , shade: 0.5 //不显示遮罩
            , shadeClose: true
        });
    }
</script>

</body>
</html>